unit ReceberLan;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, Mask, DBCtrls, Buttons, ComCtrls, ExtCtrls;

type
  TfrmReceberLan = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    StatusBar1: TStatusBar;
    Label1: TLabel;
    Label5: TLabel;
    DBEditValorRec: TDBEdit;
    DBEditDataRec: TDBEdit;
    Label6: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    DBEditJuros: TDBEdit;
    Label8: TLabel;
    Label4: TLabel;
    DBEditTitulo: TDBEdit;
    DBEditParcelas: TDBEdit;
    DBEditVencimento: TDBEdit;
    DBEditValor: TDBEdit;
    DsListaPagamentos: TDataSource;
    Label9: TLabel;
    rdgForma: TRadioGroup;
    btn_pesq_contas: TButton;
    DBEditCaixa: TDBEdit;
    stCaixaBanco: TStaticText;
    Label7: TLabel;
    procedure btn_pesq_contasClick(Sender: TObject);
  private
    { Private declarations }
  public
    procedure SetDataSource(fonte: TDataSource);
    procedure PrepararBaixa;
    procedure PrepararAlteracao;
  end;

var
  frmReceberLan: TfrmReceberLan;

implementation

uses ConModelo, DmGeral;

{$R *.dfm}

{ TFrmLancTitulos }

procedure TfrmReceberLan.PrepararAlteracao;
begin
  DBEditTitulo.Enabled        := false;
  DBEditTitulo.Brush.Color    := $00E4E7CD;
  DBEditParcelas.Enabled      := false;
  DBEditParcelas.Brush.Color  := $00E4E7CD;
  DBEditVencimento.Enabled    := true;
  DBEditValor.Enabled         := true;
  DBEditValorRec.Enabled      := true;
  DBEditDataRec.Enabled       := true;
  DBEditCaixa.Enabled         := true;
  DBEditJuros.Enabled         := true;
end;

procedure TfrmReceberLan.PrepararBaixa;
begin
  DBEditTitulo.Enabled          := false;
  DBEditTitulo.Brush.Color      := $00E4E7CD;
  DBEditParcelas.Enabled        := false;
  DBEditParcelas.Brush.Color    := $00E4E7CD;
  DBEditVencimento.Enabled      := false;
  DBEditVencimento.Brush.Color  := $00E4E7CD;
  DBEditValor.Enabled           := false;
  DBEditValor.Brush.Color       := $00E4E7CD;
  DBEditValorRec.Enabled        := true;
  DBEditDataRec.Enabled         := true;
  DBEditCaixa.Enabled           := true;
  DBEditJuros.Enabled           := true;
end;

procedure TfrmReceberLan.SetDataSource(fonte: TDataSource);
begin
  DBEditValorRec.DataSource   := fonte;
  DBEditDataRec.DataSource    := fonte;
  DBEditCaixa.DataSource      := fonte;
  DBEditJuros.DataSource      := fonte;
  DBEditParcelas.DataSource   := fonte;
  DBEditVencimento.DataSource := fonte;
  DBEditValor.DataSource      := fonte;
end;

procedure TfrmReceberLan.btn_pesq_contasClick(Sender: TObject);
begin
  {if rdgForma.ItemIndex = 0 then begin
    if TfrmConModelo.ConModFluxoCaixas then begin
      DBEditCaixa.Field.AsInteger := DtmGeral.SQLC_Consulta.FieldByName('Codigo').AsInteger;
      DBEditCaixa.SetFocus;

    end;
  end
  else begin

  end;}
end;

end.
